Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(line_annotation): use scaleAndValidate for line annotations #236

Merged

Conversation

emmacunningham
Copy link
Contributor

Summary

This PR introduces a fix for the issue where when we are in histogram mode, if a line annotation dataValue is outside of the xScale domain min & max, the line will not render. In the screenshot below, note that in regular bar series mode, the annotation line is drawn at 3.5, which in regular mode should not be visible as the xAxis ends at 3; however in histogram mode, we extend the domain by the minInterval, so the line should be visible at 3.5.

histo_line

Implementation of this fix involved passing in the enableHistogramMode to the computeXDomainLineAnnotations function so that we could leverage the scaleAndValidateDatum function already used by RectAnnotations.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)

  • This was checked for cross-browser compatibility, including a check against IE11
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios
  • Each commit follows the convention

@codecov-io
Copy link

codecov-io commented Jun 12, 2019

Codecov Report

Merging #236 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
- Coverage   97.75%   97.75%   -0.01%     
==========================================
  Files          36       36              
  Lines        2630     2626       -4     
  Branches      588      587       -1     
==========================================
- Hits         2571     2567       -4     
  Misses         52       52              
  Partials        7        7
Impacted Files Coverage Δ
src/state/annotation_utils.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01d2b60...3375328. Read the comment docs.

@emmacunningham emmacunningham added :annotation Annotation (line, rect, text) related issue bug Something isn't working labels Jun 12, 2019
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!

@emmacunningham emmacunningham merged commit 48b180a into elastic:master Jun 14, 2019
markov00 pushed a commit that referenced this pull request Jun 14, 2019
## [6.0.1](v6.0.0...v6.0.1) (2019-06-14)

### Bug Fixes

* **line_annotation:** use scaleAndValidate for line annotations ([#236](#236)) ([48b180a](48b180a))
@markov00
Copy link
Member

🎉 This PR is included in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jun 14, 2019
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
## [6.0.1](elastic/elastic-charts@v6.0.0...v6.0.1) (2019-06-14)

### Bug Fixes

* **line_annotation:** use scaleAndValidate for line annotations ([opensearch-project#236](elastic/elastic-charts#236)) ([1d57482](elastic/elastic-charts@1d57482))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:annotation Annotation (line, rect, text) related issue bug Something isn't working released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants